﻿using CommandLine;

namespace ResharperKeygen;

public class CliOptions
{
    [Option('p', "RunPatch", Required = false, HelpText = "Autorun patch", Default = true)]
    public bool RunPatch { get; set; }

    [Option('l', "ListenAddress", Required = false, HelpText = "Fake licensing service listening address")]
    public string ListenAddress { get; set; }

    public static CliOptions GetDefault()
    {
        return new CliOptions()
        {
            RunPatch = true,
            ListenAddress = "http://+:6080"
        };
    }

    public bool IsValid()
    {
        return !string.IsNullOrEmpty(ListenAddress);
    }
}